
    <!-- 项目管理 -->
    <template>
        <div class="page-box h100 display-flex czbj">
          <p class="title-label mb10" v-if="zujians!=2">
            商家详情
            <span class="red">温馨提示：点击操作列的切换商家</span>
          </p>
          <!-- sonRouter="yybureauFormationBJ" 为跳转新的页面编辑 -->
          <dxtable 
          :dataJson="dataJson"
           :portUrl="portUrl" 
           :czFun="czFun"
           :formJson="formJson"
            :qx="qx" 
            czWidth="250"
            ref="databale" ></dxtable>
        </div>
      </template>
      <script lang='ts' setup>
      import dxtable from "../../components/util/dxtable.vue";
      import sort from "../../components/util/sort.vue";
      import { dxget, dxpost, hf } from "../../util/index";
      import { NButton, NImage, NTag } from "naive-ui"
      import { h, ref, reactive } from "vue";
      import store from "../../store";
      const databale = ref();
      const initeer = () => {
        databale.value.initDataExpose();
      };
      let props = defineProps({
        zujians: { type: String },
      })
      let dataJson = [
      {
              "title": "banner图片",
              "type": "img",
              "key": "banner",
          },  {
              "title": "商家名称",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 12,
              "key": "name",
              "width": "",
              "search": true,
              "istable": true,
              "required": false
          },
          {
              "title": "商户号",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 12,
              "key": "shh",
              "width": "",
              "search": false,
              "istable": true,
              "required": false
          },
          {
              "title": "联系电话",
              "type": "input",
              "key": "phone",
          }, 
          {
              "title": "授权token",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 12,
              "key": "sqtoken",
              "width": "",
              "search": false,
              "istable": true,
              "required": false
          }
      ,
    
      {
        title: "添加时间",
        key: "addTime",
        width: 150,
      }];
      const qx = {
        DeletePermissionID: "shangjiagldel", //删除
        EditPermissionIdentifier: "shangjiaglbj", // 编辑
        NewPermissionIdentifier: "shangjiaglxz", // 新建
        ViewPermissionID: "shangjiaglck", // 查看
      };
      const portUrl = "meirong/shangjiagl/shangjiagl";
      
      let formJson = reactive([
      {
              "title": "banner图片",
              "type": "img",
              "key": "banner",
          },   {
              "title": "商家名称",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 12,
              "key": "name",
              "width": "",
              "search": false,
              "istable": true,
              "required": false
          },
          {
              "title": "商户号",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 12,
              "key": "shh",
              "width": "",
              "search": false,
              "istable": true,
              "required": false
          }, {
              "title": "联系电话",
              "type": "input",
              "key": "phone",
          }, 
          {
              "title": "授权token",
              "type": "input",
              "val": "",
              "icon": "dx-shurukuang",
              "span": 24,
              "key": "sqtoken",
              "width": "",
              "search": false,
              "istable": true,
              "required": false
          },
          {
              "title": "简介",
              "type": "textarea",
              "key": "jianjie",
          }, 
      ]);
      const czFun = {
        fun: (row) => {
          return [
            h(
              NButton,
              {
                type: "info",
                quaternary: true,
                width:300,
                onClick: async (e) => {
                    localStorage.app_auth_token =row.sqtoken
                    localStorage.ip_role_id = row.shh
                    localStorage.sjmcsee = row.name
                    window.$message.success('操作成功')
                    store.state.isjxdfd=false
                     location.reload();
                    // hf('/meirongindex')
                },
              },
              "切换商家"
            )
      
          ];
        },
      };
      
      
      // 获取字典内容
      // const xtgxxmfl = async () => {
      //   const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'xtgxxmfl' })
      //   dataJson[2].options = [
      //     {
      //       label: "全部",
      //       value: ""
      //     },
      //     ...data
      //   ]
      //   formJson[2].options = data
      //   xmlxSelect.value = data
      //   console.log(data);
      // }
      // xtgxxmfl()
      
      
      </script>
      <style scoped></style>
          